﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="KhongGianSong.ascx.cs" Inherits="WebHousingInfo.Controls.KhongGianSong" %>
<div id="noithat_200">
    <% var objectKGSong = HousingInfo.Library.NewsBOList.GetNewsBOList_ByNoiThat(9, 5);
       int idcate = -1; %>
    <div class="title">KHÔNG GIAN SỐNG</div>
    <div class="content">
        <% foreach (var objectKGSong_Detail in objectKGSong)
       {
           idcate = Convert.ToInt32(objectKGSong_Detail.CategoryID);%>       
        <div class="data">
            <% if (objectKGSong_Detail.UrlImage != "")
                {
                    if (checkurlimage(objectKGSong_Detail.UrlImage) == true)
                    {
                        string url = "TotalUpload/ImagesTotal/" + objectKGSong_Detail.UrlImage;                                                                                        
                         %><a href="ChiTietTinTuc.aspx?idnews=<%=objectKGSong_Detail.NewsID %>&idcate=<%=objectKGSong_Detail.CategoryID %>"><img src="<%=url %>" width="80" height="70" border="0" align="left" /></a>
                         <% }
                    else
                    { %><a href="ChiTietTinTuc.aspx?idnews=<%=objectKGSong_Detail.NewsID %>&idcate=<%=objectKGSong_Detail.CategoryID %>"><img src="TotalUpload/ImagesTotal/noimage.gif" width="80" height="70" border="0" align="left" /></a>
                    <% }
                }
                else
                { %>
                    <a href="ChiTietTinTuc.aspx?idnews=<%=objectKGSong_Detail.NewsID %>&idcate=<%=objectKGSong_Detail.CategoryID %>"><img src="TotalUpload/ImagesTotal/noimage.gif" width="80" height="70" border="0" align="left" /></a>
                <%} %>
	        <p style="text-align:justify; font-weight:normal;"><a href="ChiTietTinTuc.aspx?idnews=<%=objectKGSong_Detail.NewsID %>&idcate=<%=objectKGSong_Detail.CategoryID %>"><%=objectKGSong_Detail.Title%></a></p>
	       
        <% if (objectKGSong_Detail.NewsContent.Length > 90)
           { %>
         <%=objectKGSong_Detail.NewsContent.Substring(0, 89)%> ...
        <%}
           else
           { %>
        <%=objectKGSong_Detail.NewsContent%>
        <%} %>
        
        </div>
        <div class="line"></div>
        <%} %>
    </div>
    <%if (idcate == -1)
      { %>
    <div class="footer"><a href="#">Xem thêm</a></div>
    <%}
      else
      { %>
        <div class="footer"><a href="XemThemTinTuc.aspx?idcate=<%=idcate %>">Xem thêm</a></div>
    <%} %>
</div>